home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntinc20 / float.h < prev    next >
C/C++ Source or Header  |  1992-05-15  |  5KB  |  142 lines

  1. /*
  2.  * float.h
  3.  *    see sec 2.2.4.2 and 4.1.3 of ansi draft
  4.  *
  5.  *    this implementation strives to meet these values, but actually
  6.  *    does'nt quite make it, so we lie (the file was produced by gcc
  7.  *    compiled config.c on a Sun).
  8.  *    i need help here!
  9.  *        ++jrb
  10.  */
  11. #ifndef _FLOAT_H
  12. #define _FLOAT_H
  13.  
  14. #ifndef _COMPILER_H
  15. #include <compiler.h>
  16. #endif
  17.  
  18. #ifdef __SOZOBON__
  19.  
  20. /* 4/19/92 sb
  21.    These constants correspond to version 2.0 of David Brooks' floating point
  22.    library, which Sozobon 1.33i uses. */
  23.  
  24.    /* Radix of exponent representation */
  25. #define FLT_RADIX 2
  26.    /* Number of base-FLT_RADIX digits in the mantissa of a float */
  27. #define FLT_MANT_DIG 24
  28.    /* Number of decimal digits of precision in a float */
  29. #define FLT_DIG 7
  30.    /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */
  31. #define FLT_ROUNDS 1
  32.    /* Minimum float x such that 1.0+x != 1.0 */
  33. #define FLT_EPSILON ((float)1.192092891e-07)
  34.    /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
  35. #define FLT_MIN_EXP (-63)
  36.    /* Minimum normalised float */
  37. #define FLT_MIN ((float)5.421010547e-20)
  38.    /* Minimum int x such that 10**x is a normalised float */
  39. #define FLT_MIN_10_EXP (-19)
  40.    /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
  41. #define FLT_MAX_EXP 64 
  42.    /* Maximum float */
  43. #define FLT_MAX ((float)9.2233715e18)
  44.    /* Maximum int x such that 10**x is a representable float */
  45. #define FLT_MAX_10_EXP 18
  46.  
  47. /* double is identical to float */
  48. #define DBL_MANT_DIG    FLT_MANT_DIG
  49. #define DBL_DIG        FLT_DIG
  50. #define DBL_ROUNDS    FLT_ROUNDS
  51. #define DBL_EPSILON    ((double)FLT_EPSILON)
  52. #define DBL_MIN_EXP    FLT_MIN_EXP
  53. #define DBL_MIN        ((double)FLT_MIN)
  54. #define DBL_MIN_10_EXP    FLT_MIN_10_EXP
  55. #define DBL_MAX_EXP    FLT_MAX_EXP
  56. #define DBL_MAX        ((double)FLT_MAX)
  57. #define DBL_MAX_10_EXP    FLT_MAX_10_EXP
  58.  
  59. /* so is long double */
  60. #define LDBL_MANT_DIG    FLT_MANT_DIG
  61. #define LDBL_DIG    FLT_DIG
  62. #define LDBL_ROUNDS    FLT_ROUNDS
  63. #define LDBL_EPSILON    ((long double)FLT_EPSILON)
  64. #define LDBL_MIN_EXP    FLT_MIN_EXP
  65. #define LDBL_MIN    ((long double)FLT_MIN)
  66. #define LDBL_MIN_10_EXP    FLT_MIN_10_EXP
  67. #define LDBL_MAX_EXP    FLT_MAX_EXP
  68. #define LDBL_MAX    ((long double)FLT_MAX)
  69. #define LDBL_MAX_10_EXP    FLT_MAX_10_EXP
  70.  
  71. #else /* __SOZOBON__ */
  72.  
  73. /* float.h */
  74. /* Produced by config version 4.2, CWI, Amsterdam */
  75.  
  76.    /* Radix of exponent representation */
  77. #define FLT_RADIX 2
  78.    /* Number of base-FLT_RADIX digits in the mantissa of a float */
  79. #define FLT_MANT_DIG 24
  80.    /* Number of decimal digits of precision in a float */
  81. #define FLT_DIG 6
  82.    /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */
  83. #define FLT_ROUNDS 1
  84.    /* Minimum float x such that 1.0+x != 1.0 */
  85. #define FLT_EPSILON 5.96046519e-08F
  86.    /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
  87. #define FLT_MIN_EXP (-125)
  88.    /* Minimum normalised float */
  89. #define FLT_MIN 1.17549435e-38F
  90.    /* Minimum int x such that 10**x is a normalised float */
  91. #define FLT_MIN_10_EXP (-37)
  92.    /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
  93. #define FLT_MAX_EXP 128
  94.    /* Maximum float */
  95. #define FLT_MAX 3.40282347e+38F
  96.    /* Maximum int x such that 10**x is a representable float */
  97. #define FLT_MAX_10_EXP 38
  98.  
  99.    /* Number of base-FLT_RADIX digits in the mantissa of a double */
  100. #define DBL_MANT_DIG 53
  101.    /* Number of decimal digits of precision in a double */
  102. #define DBL_DIG 15
  103.    /* Minimum double x such that 1.0+x != 1.0 */
  104. #define DBL_EPSILON 1.1107651257113995e-16
  105.    /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
  106. #define DBL_MIN_EXP (-1021)
  107.    /* Minimum normalised double */
  108. #define DBL_MIN 2.2250738585072014e-308
  109.    /* Minimum int x such that 10**x is a normalised double */
  110. #define DBL_MIN_10_EXP (-307)
  111.    /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */
  112. #define DBL_MAX_EXP 1024
  113.    /* Maximum double */
  114. /*#define DBL_MAX 1.7976931348623157e+308*/
  115. #define DBL_MAX 1.7976931348623158e+308
  116.    /* Maximum int x such that 10**x is a representable double */
  117. #define DBL_MAX_10_EXP 308
  118.  
  119.    /* Number of base-FLT_RADIX digits in the mantissa of a long double */
  120. #define LDBL_MANT_DIG 53
  121.    /* Number of decimal digits of precision in a long double */
  122. #define LDBL_DIG 15
  123.    /* Minimum long double x such that 1.0+x != 1.0 */
  124. #define LDBL_EPSILON 1.1107651257113995e-16L
  125.    /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */
  126. #define LDBL_MIN_EXP (-1021)
  127.    /* Minimum normalised long double */
  128. #define LDBL_MIN 2.2250738585072014e-308L
  129.    /* Minimum int x such that 10**x is a normalised long double */
  130. #define LDBL_MIN_10_EXP (-307)
  131.    /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */
  132. #define LDBL_MAX_EXP 1024
  133.    /* Maximum long double */
  134. /*#define LDBL_MAX 1.7976931348623157e+308L*/
  135. #define LDBL_MAX 1.7976931348623158e+308
  136.    /* Maximum int x such that 10**x is a representable long double */
  137. #define LDBL_MAX_10_EXP 308
  138.  
  139. #endif /* __SOZOBON__ */
  140.  
  141. #endif /* _FLOAT_H */
  142.